import { Badge } from '/components/badge'

# Toolbar Configuration

This section is used to configure the display and behavior of the Umo Editor toolbar area.

## Default Configuration

```js
{
  toolbar: {
    defaultMode: 'ribbon',
    enableSourceEditor: true,
    menus: ['base', 'insert', 'table', 'tools', 'page', 'export'],
    disableMenuItems: [],
    importWord: {
      enabled: true,
      options: {},
      useCustomMethod: false,
    },
  },
}
```

## Configuration Item Descriptions

### toolbar.defaultMode

**Description**: The default mode of the toolbar. After configuration, users can still switch modes manually, and the choice will be saved locally. By default, the toolbar mode chosen by the user is used, but you can still force the toolbar mode to be changed using the [setToolbar](../methods#settoolbar).

**Type**: `String`

**Default**: `ribbon`

**Options**: `ribbon`, `classic`

### toolbar.enableSourceEditor

**Description**: Whether to enable the source code editing mode of the editor. In source code editing mode, users can edit the source code and preview the effects. It is suitable for developers with programming capabilities and is not recommended to be open to ordinary users.

**Type**: `Boolean`

**Default**: `false`

### toolbar.menus

**Description**: The list of toolbar menus to be enabled. By default, all menus are enabled. By configuring this item, you can disable some menus, but you cannot disable all menus and must include the `base` menu.

**Type**: `Array`

**Default**: `['base', 'insert', 'table', 'tools', 'page', 'export']`

**Options**: `base`, `insert`, `table`, `tools`, `page`, `export`

### toolbar.disableMenuItems

**Description**: The menu items to be disabled. By default, no menu items are disabled.

**Type**: `Array`

**Default**: `[]`

**Options**: `print`, `code`, `video`, `audio`, `file`,`symbol`, `textBox`, `webPage`, `chineseDate`, `emoji`, `math`, `signature`, `seal`, `diagrams`, `chineseCase`, `mermaid`,  `share`,  `embed`, `exportPDF`, ...

### toolbar.importWord <Badge theme="success">New in v3.1.0</Badge>

**Description**: Configuration related to importing Word documents.

**Type**: `Object`

**Default Value**:

```js
{
  enabled: true, 
  options: {},
  useCustomMethod: false,
}
```

**Options**:

- `enabled`: Whether to enable the Word file import feature, default is `true`.
- `options`: Mammoth configuration options, see [Mammoth](https://www.npmjs.com/package/mammoth#api) for details.
- `useCustomMethod`: Whether to use a custom method for importing Word files. You can configure this option to use a custom import method for Word files. Default is `false`. If set to `true`, it uses the [onCustomImportWordMethod](./methods#oncustomimportwordmethod) method to import Word documents.